<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class UncloseTaskClockTable extends AbstractMigration
{
    public function up()
    {
        $this->table('unclose_task_clock', ['id' => false, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '未关闭闹钟'])
            ->addColumn('id', 'integer', ['identity' => true, 'signed' => false, 'limit' => 11, 'comment' => '主键ID'])
            ->addColumn('task_id', 'integer', ['signed' => false, 'limit' => 11, 'default' => 0, 'comment' => '任务id'])
            ->addColumn('task_clock_id', 'integer', ['signed' => false, 'limit' => 11, 'default' => 0, 'comment' => '闹钟id'])
            ->addColumn('user_id', 'integer', ['null' => false, 'default' => 0, 'limit' => 11, 'signed' => false, 'comment' => '被提醒者'])
            ->save();
    }

    public function down()
    {
        $this->table('unclose_task_clock')->drop()->save();
    }
}
